<template>
  <div class="news-detail">
    <component :is="componentName"></component>
  </div>
</template>

<script>
import { useRoute, useRouter } from 'vue-router'
export default {  
  components: {
  },
  setup() {
    const route = useRoute()
    const router = useRouter()
    const componentName = ref('')
    router.isReady().then(() => {
        componentName.value = `detail${route.params.id}`
    })
    return {
      componentName
    }
  }
}

</script>
<style lang="scss" scoped>
.news-detail {
  // margin: 0 auto;
  // padding-top: 62px;
  // width: 1075px;
  
}
</style>